import koa from 'koa'
import moduleAlias from 'module-alias'
// 配置别名 @ 代表 src
moduleAlias.addAlias('@', __dirname)
const app = new koa()

// 注册全局中间件
import { registerMiddleWare } from '@/middleware/index'
registerMiddleWare(app)

//自动按文件注册所有路由
import allRouterLoader from '@/common/allRouterLoader'
allRouterLoader.init(app)

// 注册全局属性
import { registerGlobalApi } from './common/globalApi'
registerGlobalApi(app)

app.listen(3000)
console.log('server running on port 3000')
